package lc_剑指_Offer_II_004_只出现一次的数字;

public class Solution {

	public int singleNumber(int[] nums) {
		int ans = 0;
		for (int i = 0; i < 32; i++) {
			int f = 1 << i;
			int c = 0;
			for (int num : nums) {
				if ((num & f) != 0) {
					c++;
				}
			}
			if (c % 3 != 0) {
				ans |= f;
			}
		}
		return ans;
	}
}